<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>AbstractController::Base</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../css/github.css" type="text/css" media="screen" />
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Class</span> 
            AbstractController::Base 
            
                <span class="parent">&lt; 
                    
                    <a href="../Object.html">Object</a>
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../files/actionpack/lib/abstract_controller/base_rb.html">actionpack/lib/abstract_controller/base.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  
    <div class="description">
      
<p><code>AbstractController::Base</code> is a low-level API. Nobody should be
using it directly, and subclasses (like <a
href="../ActionController/Base.html">ActionController::Base</a>) are
expected to provide their own <code>render</code> method, since rendering
means different things depending on the context.</p>

    </div>
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>A</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Base.html#method-c-abstract-21">abstract!</a>,
              </li>
            
              
              <li>
                <a href="Base.html#method-i-action_methods">action_methods</a>,
              </li>
            
              
              <li>
                <a href="Base.html#method-c-action_methods">action_methods</a>,
              </li>
            
              
              <li>
                <a href="Base.html#method-i-available_action-3F">available_action?</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>C</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Base.html#method-c-clear_action_methods-21">clear_action_methods!</a>,
              </li>
            
              
              <li>
                <a href="Base.html#method-i-controller_path">controller_path</a>,
              </li>
            
              
              <li>
                <a href="Base.html#method-c-controller_path">controller_path</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>H</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Base.html#method-c-hidden_actions">hidden_actions</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>I</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Base.html#method-c-internal_methods">internal_methods</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>M</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Base.html#method-c-method_added">method_added</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>P</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Base.html#method-i-process">process</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  
    <!-- Includes -->
    <div class="sectiontitle">Included Modules</div>
    <ul>
      
        <li>
          
            <a href="../ActiveSupport/Configurable.html">
              ActiveSupport::Configurable
            </a>
          
        </li>
      
    </ul>
  



  

    

    

    


    
      <!-- Section attributes -->
      <div class="sectiontitle">Attributes</div>
      <table border='0' cellpadding='5'>
        
          <tr valign='top'>
            <td class='attr-rw'>
              [R]
            </td>
            <td class='attr-name'>abstract</td>
            <td class='attr-desc'></td>
          </tr>
        
          <tr valign='top'>
            <td class='attr-rw'>
              [R]
            </td>
            <td class='attr-name'>abstract?</td>
            <td class='attr-desc'></td>
          </tr>
        
      </table>
    


    <!-- Methods -->
    
      <div class="sectiontitle">Class Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-c-abstract-21">
            
              <b>abstract!</b>()
            
            <a href="Base.html#method-c-abstract-21" name="method-c-abstract-21" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Define a controller as abstract. See <a
href="Base.html#method-c-internal_methods">::internal_methods</a> for more
details.</p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-abstract-21_source')" id="l_method-c-abstract-21_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/396bb77199883773c8ce9ef53365a8fc0cac37f8/actionpack/lib/abstract_controller/base.rb#L33" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-abstract-21_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/abstract_controller/base.rb, line 33</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">abstract!</span>
  <span class="ruby-ivar">@abstract</span> = <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-c-action_methods">
            
              <b>action_methods</b>()
            
            <a href="Base.html#method-c-action_methods" name="method-c-action_methods" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>A list of method names that should be considered actions. This includes all
public instance methods on a controller, less any internal methods (see
internal_methods), adding back in any methods that are internal, but still
exist on the class itself. Finally, hidden_actions are removed.</p>

<h4 id="method-c-action_methods-label-Returns">Returns</h4>
<ul><li>
<p><code>Set</code> - A set of all methods that should be considered actions.</p>
</li></ul>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-action_methods_source')" id="l_method-c-action_methods_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/396bb77199883773c8ce9ef53365a8fc0cac37f8/actionpack/lib/abstract_controller/base.rb#L77" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-action_methods_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/abstract_controller/base.rb, line 77</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">action_methods</span>
  <span class="ruby-ivar">@action_methods</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">begin</span>
    <span class="ruby-comment"># All public instance methods of this class, including ancestors</span>
    <span class="ruby-identifier">methods</span> = (<span class="ruby-identifier">public_instance_methods</span>(<span class="ruby-keyword">true</span>) <span class="ruby-operator">-</span>
      <span class="ruby-comment"># Except for public instance methods of Base and its ancestors</span>
      <span class="ruby-identifier">internal_methods</span> <span class="ruby-operator">+</span>
      <span class="ruby-comment"># Be sure to include shadowed public instance methods of this class</span>
      <span class="ruby-identifier">public_instance_methods</span>(<span class="ruby-keyword">false</span>)).<span class="ruby-identifier">uniq</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">to_s</span> } <span class="ruby-operator">-</span>
      <span class="ruby-comment"># And always exclude explicitly hidden actions</span>
      <span class="ruby-identifier">hidden_actions</span>.<span class="ruby-identifier">to_a</span>

    <span class="ruby-comment"># Clear out AS callback method pollution</span>
    <span class="ruby-constant">Set</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">methods</span>.<span class="ruby-identifier">reject</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">method</span><span class="ruby-operator">|</span> <span class="ruby-identifier">method</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/_one_time_conditions/</span> })
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-c-clear_action_methods-21">
            
              <b>clear_action_methods!</b>()
            
            <a href="Base.html#method-c-clear_action_methods-21" name="method-c-clear_action_methods-21" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p><a href="Base.html#method-c-action_methods">::action_methods</a> are cached
and there is sometimes need to refresh them. clear_action_methods! allows
you to do that, so next time you run <a
href="Base.html#method-c-action_methods">::action_methods</a>, they will be
recalculated</p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-clear_action_methods-21_source')" id="l_method-c-clear_action_methods-21_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/396bb77199883773c8ce9ef53365a8fc0cac37f8/actionpack/lib/abstract_controller/base.rb#L96" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-clear_action_methods-21_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/abstract_controller/base.rb, line 96</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">clear_action_methods!</span>
  <span class="ruby-ivar">@action_methods</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-c-controller_path">
            
              <b>controller_path</b>()
            
            <a href="Base.html#method-c-controller_path" name="method-c-controller_path" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Returns the full controller name, underscored, without the ending
Controller. For instance, MyApp::MyPostsController would return
“my_app/my_posts” for controller_path.</p>

<h4 id="method-c-controller_path-label-Returns">Returns</h4>
<ul><li>
<p><code>String</code></p>
</li></ul>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-controller_path_source')" id="l_method-c-controller_path_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/396bb77199883773c8ce9ef53365a8fc0cac37f8/actionpack/lib/abstract_controller/base.rb#L106" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-controller_path_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/abstract_controller/base.rb, line 106</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">controller_path</span>
  <span class="ruby-ivar">@controller_path</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/Controller$/</span>, <span class="ruby-string">''</span>).<span class="ruby-identifier">underscore</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">anonymous?</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-c-hidden_actions">
            
              <b>hidden_actions</b>()
            
            <a href="Base.html#method-c-hidden_actions" name="method-c-hidden_actions" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>The list of hidden actions. Defaults to an empty array. This can be
modified by other modules or subclasses to specify particular actions as
hidden.</p>

<h4 id="method-c-hidden_actions-label-Returns">Returns</h4>
<ul><li>
<p><code>Array</code> - An array of method names that should not be considered
actions.</p>
</li></ul>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-hidden_actions_source')" id="l_method-c-hidden_actions_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/396bb77199883773c8ce9ef53365a8fc0cac37f8/actionpack/lib/abstract_controller/base.rb#L65" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-hidden_actions_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/abstract_controller/base.rb, line 65</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">hidden_actions</span>
  []
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-c-internal_methods">
            
              <b>internal_methods</b>()
            
            <a href="Base.html#method-c-internal_methods" name="method-c-internal_methods" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>A list of all internal methods for a controller. This finds the first
abstract superclass of a controller, and gets a list of all public instance
methods on that abstract class. Public instance methods of a controller
would normally be considered action methods, so methods declared on
abstract classes are being removed. (<a
href="../ActionController/Metal.html">ActionController::Metal</a> and <a
href="../ActionController/Base.html">ActionController::Base</a> are defined
as abstract)</p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-internal_methods_source')" id="l_method-c-internal_methods_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/396bb77199883773c8ce9ef53365a8fc0cac37f8/actionpack/lib/abstract_controller/base.rb#L52" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-internal_methods_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/abstract_controller/base.rb, line 52</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">internal_methods</span>
  <span class="ruby-identifier">controller</span> = <span class="ruby-keyword">self</span>

  <span class="ruby-identifier">controller</span> = <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">superclass</span> <span class="ruby-keyword">until</span> <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">abstract?</span>
  <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">public_instance_methods</span>(<span class="ruby-keyword">true</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-c-method_added">
            
              <b>method_added</b>(name)
            
            <a href="Base.html#method-c-method_added" name="method-c-method_added" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Refresh the cached <a
href="Base.html#method-c-action_methods">::action_methods</a> when a new
action_method is added.</p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-method_added_source')" id="l_method-c-method_added_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/396bb77199883773c8ce9ef53365a8fc0cac37f8/actionpack/lib/abstract_controller/base.rb#L111" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-method_added_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/abstract_controller/base.rb, line 111</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">method_added</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-keyword">super</span>
  <span class="ruby-identifier">clear_action_methods!</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                  
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-action_methods">
            
              <b>action_methods</b>()
            
            <a href="Base.html#method-i-action_methods" name="method-i-action_methods" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Delegates to the class’ <a
href="Base.html#method-i-action_methods">action_methods</a></p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-action_methods_source')" id="l_method-i-action_methods_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/396bb77199883773c8ce9ef53365a8fc0cac37f8/actionpack/lib/abstract_controller/base.rb#L145" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-action_methods_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/abstract_controller/base.rb, line 145</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">action_methods</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">action_methods</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-available_action-3F">
            
              <b>available_action?</b>(action_name)
            
            <a href="Base.html#method-i-available_action-3F" name="method-i-available_action-3F" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Returns true if a method for the action is available and can be dispatched,
false otherwise.</p>

<p>Notice that <code>action_methods.include?(&quot;foo&quot;)</code> may
return false and <code>available_action?(&quot;foo&quot;)</code> returns
true because this method considers actions that are also available through
other means, for example, implicit render ones.</p>

<h4 id="method-i-available_action-3F-label-Parameters">Parameters</h4>
<ul><li>
<p><code>action_name</code> - The name of an action to be tested</p>
</li></ul>

<h4 id="method-i-available_action-3F-label-Returns">Returns</h4>
<ul><li>
<p><code>TrueClass</code>, <code>FalseClass</code></p>
</li></ul>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-available_action-3F_source')" id="l_method-i-available_action-3F_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/396bb77199883773c8ce9ef53365a8fc0cac37f8/actionpack/lib/abstract_controller/base.rb#L162" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-available_action-3F_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/abstract_controller/base.rb, line 162</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">available_action?</span>(<span class="ruby-identifier">action_name</span>)
  <span class="ruby-identifier">method_for_action</span>(<span class="ruby-identifier">action_name</span>).<span class="ruby-identifier">present?</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-controller_path">
            
              <b>controller_path</b>()
            
            <a href="Base.html#method-i-controller_path" name="method-i-controller_path" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Delegates to the class’ <a
href="Base.html#method-i-controller_path">controller_path</a></p>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-controller_path_source')" id="l_method-i-controller_path_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/396bb77199883773c8ce9ef53365a8fc0cac37f8/actionpack/lib/abstract_controller/base.rb#L140" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-controller_path_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/abstract_controller/base.rb, line 140</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">controller_path</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">controller_path</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-process">
            
              <b>process</b>(action, *args)
            
            <a href="Base.html#method-i-process" name="method-i-process" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              <p>Calls the action going through the entire action dispatch stack.</p>

<p>The actual method that is called is determined by calling
method_for_action. If no method can handle the action, then an
ActionNotFound error is raised.</p>

<h4 id="method-i-process-label-Returns">Returns</h4>
<ul><li>
<p><code>self</code></p>
</li></ul>
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-process_source')" id="l_method-i-process_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/396bb77199883773c8ce9ef53365a8fc0cac37f8/actionpack/lib/abstract_controller/base.rb#L127" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-process_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/abstract_controller/base.rb, line 127</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">process</span>(<span class="ruby-identifier">action</span>, *<span class="ruby-identifier">args</span>)
  <span class="ruby-ivar">@_action_name</span> = <span class="ruby-identifier">action_name</span> = <span class="ruby-identifier">action</span>.<span class="ruby-identifier">to_s</span>

  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">action_name</span> = <span class="ruby-identifier">method_for_action</span>(<span class="ruby-identifier">action_name</span>)
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">ActionNotFound</span>, <span class="ruby-node">&quot;The action '#{action}' could not be found for #{self.class.name}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@_response_body</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-identifier">process_action</span>(<span class="ruby-identifier">action_name</span>, *<span class="ruby-identifier">args</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    